#ifndef MIMETYPE_H
#define MIMETYPE_H

#include <QtCore/QList>
#include <QtCore/QPair>
#include <QtCore/QStringList>

typedef QList<QPair<QString, uint> > GlobalPatternList;

namespace core
{

class MimeType
{
public:
    MimeType();
    MimeType(const QString& name, const QString& type, const QString& icon,
        const GlobalPatternList& globalPatterns, const QString& comment);

    QString name() const;

    QString comment() const;
    QString iconName() const;

    QString filterString() const;
    QStringList globalPatterns() const;

    QString type() const;

    QString preferredSuffix() const;
    QStringList suffixes() const;

    bool isValid() const;

    bool operator==(const MimeType& other) const;
    bool operator!=(const MimeType& other) const;

private:
    bool m_isValid;
    QString m_name;
    QString m_type;
    QString m_icon;
    QString m_comment;
    GlobalPatternList m_globalPatterns;
    QStringList m_suffixes;
    QStringList m_actualGlobalPatterns;
};

} // namespace core

uint qHash(const core::MimeType& type);

#endif
